﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Icst.Leaflike.Web;

using System.Web.UI.HtmlControls;
using Icst.Leaflike.Data;

namespace Icst.Leaflike.Web.search
{
    public partial class similar : Page
    {
        protected IEnumerable<tree_similarResult> _results = new List<tree_similarResult>();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int page = Request["page"] == null ? 1 : int.Parse(Request["page"]);
                int treeno = Request["tree"] == null ? 1 : int.Parse(Request["tree"]);
                int total = 0;
                _results = Tree.Instance.SearchSimilar(treeno, page, 10, out total);
                paginator.RecordCount = total;
                resultPanel.Visible = total > 0;
                emptyPanel.Visible = total == 0;
            }
        }
    }
}
